﻿using System;
using System.Windows.Forms;
using DevExpress.LookAndFeel;
using System.Configuration;

namespace EastFantasy.DnfAccountScan.Main
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //DevExpress.Skins.SkinManager.EnableFormSkins();
            //DevExpress.UserSkins.BonusSkins.Register();
            //UserLookAndFeel.Default.SetSkinStyle("DevExpress Style");
            //Loading.LoadAndRun(new Main());

            Application.Run(new Main());
            //EncryptConfiguration();
            //Application.Run(new Loading());
            //loading.ShowMain();
            //loading.Dispose();

        }

        static void EncryptConfiguration()
        {   // 使用什么类型的加密
            string provider = "RsaProtectedConfigurationProvider";
            Configuration config = null;
            config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);

            // 加密连接字符串
            ConfigurationSection section = config.ConnectionStrings;
            if ((section.SectionInformation.IsProtected == false) &&
            (section.ElementInformation.IsLocked == false))
            {
                section.SectionInformation.ProtectSection(provider);
                section.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Full);
            }
        }
    }
}